package com.es.service.impl;

import com.es.entity.Student;
import com.es.mapper.StudentMapper;
import com.es.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper mapper;

    @Override
    @Transactional(noRollbackFor = ArithmeticException.class)
    public int save(Student student) {
        int i =  mapper.save(student);
        int ii = 10/0;
        return i;
    }

    @Override
    public int update(Student student) {
        return mapper.update(student);
    }
}
